package com.iRomantic.domain.entity;

import java.util.UUID;

import com.iRomantic.config.Constant;
import com.jfinal.plugin.activerecord.Model;

/**
 * 酒店
 * @author serenity
 *
 */
public class Hotel extends Model<Hotel>{

	private static final long serialVersionUID = 3447816308134377340L;
	
	public static final Hotel DAO = new Hotel();
	
	public boolean save(){
		if(this.getStr("id")==null){
			this.set("id", UUID.randomUUID().toString());
		}
		return super.save();
	}
	
	public void setPictureProjectPath(Hotel hotel){
		if(null!=hotel.getStr("pictureUrl")){
			hotel.set("pictureUrl", Constant.OSS_PATH+Constant.HOTEL_PICTURE+hotel.getStr("id")+"/"+hotel.getStr("pictureUrl"));
		}
	}

}
